const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('act_fo_form_instance', {
    id: {
      type: DataTypes.STRING(255),
      allowNull: false,
      primaryKey: true,
      field: 'ID_'
    },
    formDefinitionId: {
      type: DataTypes.STRING(255),
      allowNull: false,
      field: 'FORM_DEFINITION_ID_'
    },
    taskId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'TASK_ID_'
    },
    procInstId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'PROC_INST_ID_'
    },
    procDefId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'PROC_DEF_ID_'
    },
    submittedDate: {
      type: DataTypes.DATE(3),
      allowNull: true,
      field: 'SUBMITTED_DATE_'
    },
    submittedBy: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'SUBMITTED_BY_'
    },
    formValuesId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'FORM_VALUES_ID_'
    },
    tenantId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'TENANT_ID_'
    },
    scopeId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'SCOPE_ID_'
    },
    scopeType: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'SCOPE_TYPE_'
    },
    scopeDefinitionId: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'SCOPE_DEFINITION_ID_'
    }
  }, {
    sequelize,
    tableName: 'act_fo_form_instance',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "ID_" },
        ]
      },
    ]
  });
};
